package com.hmy.gateway.common.ribbon;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

@Data
@Component
@ConfigurationProperties(prefix = RibbonOkHttpProperties.PREFIX)
public class RibbonOkHttpProperties {

    public static final String PREFIX = "ribbon.okhttp";

    /**
     * 最大空闲链接
     */
    private int maxIdleConnections = 500;

    /**
     * 保持连接时间
     */
    private long keepAliveDuration = 900L;

    /**
     * 保持连接时间单位
     */
    private TimeUnit timeUnit = TimeUnit.SECONDS;

}
